#列表
#[表达式 for 变量 in 迭代对象 if 条件]
from main import print_hi

squares = []
for x in range(10):
    squares.append(x**2)

squares = [x**2 for x in range(10)]
print(squares)

#数据过滤

even = [x for x in range(10) if x%2 == 0]
print(even)

#字符串处理
text = 'hello world'
uppercase = [char for char in text if char.isupper()]
print(uppercase)

#多重循环
coordinates = [(x,y) for x in range(3) for y in range(3)]
print(coordinates)